<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>LinkedChat招聘网</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/public/static/css/companyHomePage.css">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/public/static/css/Headers.css">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/public/static/css/Footers.css">
    <link href="${pageContext.request.contextPath}/public/static/images/login_icon.ico" rel="shortcut icon">
    <script src="../static/js/jquery-3.6.0.min.js"></script>
</head>
<body>
<!--头部-->
<div id="header">
</div>
<script>
    $(function() {
        $('#header').load('${pageContext.request.contextPath}/public/Person/header.jsp');
    })
</script>



<!--主体-->
<div class="main">
    <!--求职期望-->
    <div class="filter-box">
        <!--条件筛选-->
        <div class="filter-condition">
            <div class="filter-row location">
                <span class = "title">公司地点：</span>
                <span class ="content">
                    <a href="javascript:void(0)" class="location_a">全国</a>
                    <a href="javascript:void(0)" class="location_a" style = "color:#00d7c6">苏州</a>
                    <a href="javascript:void(0)" class="location_a">上海</a>
                    <a href="javascript:void(0)" class="location_a">广州</a>
                    <a href="javascript:void(0)" class="location_a">深圳</a>
                    <a href="javascript:void(0)" class="location_a">杭州</a>
                    <a href="javascript:void(0)" class="location_a">天津</a>
                    <a href="javascript:void(0)" class="location_a">西安</a>
                    <a href="javascript:void(0)" class="location_a">武汉</a>
                    <a href="javascript:void(0)" class="location_a">厦门</a>
                    <a href="javascript:void(0)" class="location_a">长沙</a>
                    <a href="javascript:void(0)" class="location_a">成都</a>
                    <a href="javascript:void(0)" class="location_a">郑州</a>
                    <a href="javascript:void(0)" class="location_a">重庆</a>
                    <a href="javascript:void(0)" class="location_a">全部城市</a>

                </span>
            </div>
            <div class="filter-row industry">
                <span class = "title">行业类型：</span>
                <span class ="content content_b">
                    <a href="javascript:void(0)" class="location_b" style="color: #00d7c6">不限</a>
                    <a href="javascript:void(0)" class="location_b">移动互联网</a>
                    <a href="javascript:void(0)" class="location_b">互联网</a>
                    <a href="javascript:void(0)" class="location_b" >计算机</a>
                    <a href="javascript:void(0)" class="location_b">电商</a>
                    <a href="javascript:void(0)" class="location_b">游戏</a>
                    <a href="javascript:void(0)" class="location_b">媒体</a>
                    <a href="javascript:void(0)" class="location_b">广告营销</a>
                    <a href="javascript:void(0)" class="location_b">数据服务</a>
                    <a href="javascript:void(0)" class="location_b">医疗健康</a>
                    <a href="javascript:void(0)" class="location_b">生活服务</a>
                    <a href="javascript:void(0)" class="location_b">旅游</a>
                    <a href="javascript:void(0)" class="location_b">分类信息</a>
                    <a href="javascript:void(0)" class="location_b">音乐/视频/阅读</a>
                    <a href="javascript:void(0)" class="location_b">在线教育</a>
                    <a href="javascript:void(0)" class="location_b">社交网络</a>
                    <a href="javascript:void(0)" class="location_b">人力资源服务</a>
                    <a href="javascript:void(0)" class="location_b">企业服务</a>
                    <a href="javascript:void(0)" class="location_b">信息安全</a>
                    <a href="javascript:void(0)" class="location_b">智能硬件</a>
                    <a href="javascript:void(0)" class="location_b">通信/网络设备</a>
                    <a href="javascript:void(0)" class="location_b">广告/公关/会展</a>
                    <a href="javascript:void(0)" class="location_b">互联网金融</a>
                    <a href="javascript:void(0)" class="location_b">物流/仓储</a>
                    <a href="javascript:void(0)" class="location_b">贸易/进出口</a>
                    <a href="javascript:void(0)" class="location_b">咨询</a>
                    <a href="javascript:void(0)" class="location_b">工程施工</a>
                    <a href="javascript:void(0)" class="location_b">汽车生产</a>
                    <a href="javascript:void(0)" class="location_b">其他行业</a>

                </span>
            </div>
            <div class="filter-row scale">
                <span class = "title">融资阶段：</span>
                <span class ="content content_c">
                    <a href="javascript:void(0)" class="location_c">不限</a>
                    <a href="javascript:void(0)" class="location_c">未融资</a>
                    <a href="javascript:void(0)" class="location_c" style="color: #00d7c6">天使轮</a>
                    <a href="javascript:void(0)" class="location_c">A轮</a>
                    <a href="javascript:void(0)" class="location_c">B轮</a>
                    <a href="javascript:void(0)" class="location_c">C轮</a>
                    <a href="javascript:void(0)" class="location_c">D轮及以上</a>
                    <a href="javascript:void(0)" class="location_c">已上市</a>
                    <a href="javascript:void(0)" class="location_c">不需要融资</a>

                </span>
            </div>
            <div class="filter-row scale">
                <span class = "title">公司规模：</span>
                <span class ="content content_d">
                    <a href="javascript:void(0)" class="location_d">不限</a>
                    <a href="javascript:void(0)" class="location_d" style="color: #00d7c6">0-20人</a>
                    <a href="javascript:void(0)" class="location_d">20-99人</a>
                    <a href="javascript:void(0)" class="location_d">100-499人</a>
                    <a href="javascript:void(0)" class="location_d">500-999人</a>
                    <a href="javascript:void(0)" class="location_d">1000-9999人</a>
                    <a href="javascript:void(0)" class="location_d">10000人以上</a>
                </span>
            </div>
            <div class="expect"></div>
        </div>
        <div class="companylistbody">
            <!--头部固定定位-->
            <div class="top-filter-bar ">
                <input type="checkbox" class="select_company">
                <span>根据简历精准匹配</span>
            </div>

            <!--公司列表-->
            <div class="company-list">
                <ul id = "companyList"></ul>
            </div>
        </div>



    </div>
</div>

<!--底部-->
<div id ="footer">
    <div class="footer_i">
        <div class="footer_i_left">
            <p>
                <span>Copyright  2022 LinkedChat</span>
                <span>京ICP备14013441号-5</span>
                <span>京ICP证150923号</span>
                <span>京网文[2020]0399-066 号</span>
                <span>
                 <img src="https://static.zhipin.com/v2/web/geek/images/icon-badge-1.png">电子营业执照
              </span>
                <span>
                  <img src="https://static.zhipin.com/v2/web/geek/images/icon-beian.png"> 京公网安备11010502032801
              </span>
                <span>朝阳网警</span>
                <span>人力资源服务许可证</span>
                <span>网上有害信息举报专区</span>
                <span>朝阳区人社局监督电话</span>
            </p>
        </div>
        <div class="footer_i_right">
            <a href="#" class="icon_weibo"><span></span></a>
            <a href="#" class="icon-weixin"><span></span></a>
            <a href="#" class="icon-app"><span></span></a>
            <a href="#" class="icon-client-app">
                <img src="https://img.bosszhipin.com/static/file/2021/dppx09luaq1637052502211.png" class="icon_im">
                <span></span></a>
        </div>
    </div>
</div>

<a style=""></a>
<script src = "${pageContext.request.contextPath}/public/static/js/company_home_page.js"></script>
<script>

    <%--初始化页面数据，全部展示--%>
    window.onload = function (){
        $.ajax({
            type:"POST",
            url:"${pageContext.request.contextPath}/companyDetail/selectAllCompany",
            dataType:"json",
            data: {
                companyIndustry:null,
                companyFinance:null,
                companyScale:null
            },
            success:function (result){
                console.log(result)
                for(var i = 0;i<result.object.length;i++){
                    var companyDetail = result.object[i].companyDetail
                    var jobDetali = null;
                    if(result.object[i].jobDetailList.length === 0){
                        jobDetali = {
                            jobName:"该公司没有职位",
                            jobMaxSalary:0,
                            jobMinSalary:0
                        }
                    }else {
                        jobDetali = result.object[i].jobDetailList[0]
                    }
                    // console.log(i)
                    // console.log(result.object.list[i])
                    // console.log(result.object.list[i].companyDetail)
                    // console.log(result.object.list[i].jobDetailList[0])
                    var liEle = '<li> <div class="sub-li">'+
                        '<a href="${pageContext.request.contextPath}/companyDetail/toCompanyDetail?companyId='+companyDetail.companyId+'" class="li_a">'+
                        '<img src="'+companyDetail.companyImg +'"/>'+
                        '<div class="li_content">'+
                        '<h4>'+companyDetail.companyName +'</h4>'+
                        '<p>'+companyDetail.companyFinance +'<span class="vline"></span>'+companyDetail.companyIndustry+''+
                        '</p></div> </a><a href="javascript:void(0)" class="about_info">'+
                        '<p>热招<u class="h">'+jobDetali.jobName+'</u>'+
                        ''+jobDetali.jobMaxSalary+'-'+jobDetali.jobMinSalary+'k </p></a> </div></li>'
                    $("#companyList").append(liEle)
                }

            }
        })
    }

    var companyIndustry;

    document.querySelector('.content_b').onclick=function (event){
        var ele = event.target;
        console.log(ele.nodeName);
        console.log(ele.innerHTML);
        companyIndustry = ele.innerHTML;
        var Aarrs = document.querySelector(".location_b").parentElement.children;
        console.log(Aarrs.length)
        for (let i = 0; i < Aarrs.length; i++) {
            Aarrs[i].style.color = "#414a60";
        }
        ele.style.color = '#00d7c6'
    }
    $('.content_b').click(function (){
        $.ajax({
            type:"POST",
            url:"${pageContext.request.contextPath}/companyDetail/selectAllCompany",
            dataType:"json",
            data: {
                companyIndustry:companyIndustry,
                companyFinance:null,
                companyScale:null
            },
            success:function (result){
                console.log(result)
                $("#companyList").empty();
                for(var i = 0;i<result.object.length;i++){
                    var companyDetail = result.object[i].companyDetail
                    var jobDetali = null;
                    if(result.object[i].jobDetailList.length === 0){
                        jobDetali = {
                            jobName:"该公司没有职位",
                            jobMaxSalary:0,
                            jobMinSalary:0
                        }
                    }else {
                        jobDetali = result.object[i].jobDetailList[0]
                    }
                    // console.log(i)
                    // console.log(result.object.list[i])
                    // console.log(result.object.list[i].companyDetail)
                    // console.log(result.object.list[i].jobDetailList[0])
                    var liEle = '<li> <div class="sub-li">'+
                        '<a href="${pageContext.request.contextPath}/companyDetail/toCompanyDetail?companyId='+companyDetail.companyId+'" class="li_a">'+
                        '<img src="'+companyDetail.companyImg +'"/>'+
                        '<div class="li_content">'+
                        '<h4>'+companyDetail.companyName +'</h4>'+
                        '<p>'+companyDetail.companyFinance +'<span class="vline"></span>'+companyDetail.companyIndustry+''+
                        '</p></div> </a><a href="javascript:void(0)" class="about_info">'+
                        '<p>热招<u class="h">'+jobDetali.jobName+'</u>'+
                        ''+jobDetali.jobMaxSalary+'-'+jobDetali.jobMinSalary+'k </p></a> </div></li>'
                    $("#companyList").append(liEle)
                }

            }
        })
    })


</script>

</body>
</html>